import http from '@/utils/http/axios';

/**
 * @description: 角色列表
 */
export function getRoleList(params) {
  return http.request({
    url: '/sys/role',
    method: 'GET',
    params,
  });
}
export function roleList() {
  return http.request({
    url: '/sys/role/getRoleList',
    method: 'GET',
  });
}
/**
 * 保存菜单权限
 * @param data
 */
export function saveRolePermission(data) {
  return http.request({
    url: '/sys/role/saveRolePermission',
    method: 'post',
    data,
  });
}

/**
 * 添加角色
 * @param data
 */
export function saveRole(data) {
  return http.request({
    url: '/sys/role',
    method: 'post',
    data,
  });
}
/**
 * 修改角色
 * @param data
 */
export function updateRole(data) {
  return http.request({
    url: '/sys/role',
    method: 'put',
    data,
  });
}

/**
 * 删除角色
 * @param ids
 */
export function deleteRole(ids) {
  return http.request({
    url: `/sys/role/${ids}`,
    method: 'delete',
  });
}
